/*    */ package com.newcrm.webapi.sub;
/*    */ 
/*    */ import com.newcrm.bean.User;
/*    */ import com.newcrm.db.CustomerManager;
/*    */ import com.newcrm.exception.NotFoundException;
/*    */ import com.newcrm.util.Util;
/*    */ import com.newcrm.webapi.AbstractAction;
/*    */ import com.newcrm.webapi.AbstractHttpServlet;
/*    */ import java.io.IOException;
/*    */ import java.io.PrintWriter;
/*    */ import javax.servlet.ServletException;
/*    */ import javax.servlet.http.HttpServletRequest;
/*    */ import javax.servlet.http.HttpServletResponse;
/*    */ import net.sf.json.JSONArray;
/*    */ 
/*    */ public class ListCustomerName extends AbstractAction
/*    */ {
/*    */   public ListCustomerName(AbstractHttpServlet servlet)
/*    */   {
/* 28 */     super(servlet);
/*    */   }
/*    */ 
/*    */   public void parse(HttpServletRequest request, HttpServletResponse response)
/*    */     throws IOException, ServletException, NotFoundException
/*    */   {
/* 37 */     response.setContentType("text/html;charset=utf-8");
/* 38 */     User user = super.getLoginUser(request);
/* 39 */     PrintWriter out = response.getWriter();
/* 40 */     String term = Util.getURLParameter(request.getParameter("term"));
/* 41 */     int type = Util.str2Int(request.getParameter("type"));
/*    */ 
/* 43 */     boolean isFromDeals = "1".equals(request.getParameter("isFromDeals"));
/*    */ 
/* 45 */     CustomerManager manager = new CustomerManager();
/* 46 */     int companyId = super.getLoginUser(request).companyId;
/*    */ 
/* 49 */     JSONArray array = JSONArray.fromObject(manager.getCustomerName(
/* 50 */       companyId, term, user.isAdmin, user.userId, type, isFromDeals));
/* 51 */     out.println(array);
/* 52 */     out.flush();
/* 53 */     out.close();
/*    */   }
/*    */ }

/* Location:           C:\E\referenceProject\CRM参考\qikebao\WEB-INF\lib\qikebao.jar
 * Qualified Name:     com.newcrm.webapi.sub.ListCustomerName
 * JD-Core Version:    0.6.1
 */